package org.zfes.snowier.zbss.xzy.mo.dtos.mysql;

import java.util.Date;
import org.zfes.snowier.zbss.xzy.mo.dtos.IBaseMDto;

public class MysqlMoDto extends IBaseMDto implements Cloneable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	//所属部署拓扑
	private String devicesn;
	//实例key
	private String inskey;
	//实例秒数
	private String insremark;
	private Byte st;
	private Date ti;
	private String message;
	
	
	private String host;
	private Integer port;
	private Integer tps;
	private Integer qps;
	private Integer questions;
	private Integer comselect;
	private Integer cominsert;
	private Integer comdelete;
	private Integer comupdate;
	private Integer combegin;
	private Integer comcommit;
	private Integer comrollback;
	private Integer maxusedconnections;
	private Integer threadsconnected;
	private Integer connections;
	private Integer threadsrunning;
	private Integer bytesreceived;
	private Integer bytessent;
	private Integer opentables;
	private Long uptime;

	
	public static MysqlMoDto convert(MysqlOreginData data) {
		return new MysqlMoDto()
			.setDevicesn(data.getDevicesn())
			.setInskey(data.getInskey())
			.setInsremark(data.getInsremark())
			.setHost(data.getHost())
			.setPort(data.getPort())
			.setSt(data.getStatusCode())
			.setTi(data.getDate())
			.setMessage(data.getMessage())
			.setTps(data.getTps())
			.setQps(data.getQps())
			.setQuestions(data.getQuestions())
			.setComselect(data.getCom_select())
			.setCominsert(data.getCom_delete())
			.setComdelete(data.getCom_delete())
			.setComupdate(data.getCom_update())
			.setCombegin(data.getCom_begin())
			.setComcommit(data.getCom_commit())
			.setComrollback(data.getCom_rollback())
			.setMaxusedconnections(data.getMax_used_connections())
			.setThreadsconnected(data.getThreads_connected())
			.setConnections(data.getConnections())
			.setThreadsrunning(data.getThreads_running())
			.setBytesreceived(data.getBytes_received())
			.setBytessent(data.getBytes_sent())
			.setOpentables(data.getOpen_tables())
			.setUptime(data.getUptime()==null?0:Long.valueOf(""+data.getUptime()));
		
	}
	
	public String getDevicesn() {
		return devicesn;
	}
	public MysqlMoDto setDevicesn(String devicesn) {
		this.devicesn = devicesn;
		return this;
	}
	public String getHost() {
		return host;
	}
	public MysqlMoDto setHost(String host) {
		this.host = host;
		return this;
	}
	public Integer getPort() {
		return port;
	}
	public MysqlMoDto setPort(Integer port) {
		this.port = port;
		return this;
	}
	public Byte getSt() {
		return st;
	}
	public MysqlMoDto setSt(Byte st) {
		this.st = st;
		return this;
	}
	public Date getTi() {
		return ti;
	}
	public MysqlMoDto setTi(Date ti) {
		this.ti = ti;
		return this;
	}
	public String getMessage() {
		return message;
	}
	public MysqlMoDto setMessage(String message) {
		this.message = message;
		return this;
	}
	public Integer getTps() {
		return tps;
	}
	public MysqlMoDto setTps(Integer tps) {
		this.tps = tps;
		return this;
	}
	public Integer getQps() {
		return qps;
	}
	public MysqlMoDto setQps(Integer qps) {
		this.qps = qps;
		return this;
	}
	public Integer getQuestions() {
		return questions;
	}
	public MysqlMoDto setQuestions(Integer questions) {
		this.questions = questions;
		return this;
	}
	public Integer getComselect() {
		return comselect;
	}
	public MysqlMoDto setComselect(Integer comselect) {
		this.comselect = comselect;
		return this;
	}
	public Integer getCominsert() {
		return cominsert;
	}
	public MysqlMoDto setCominsert(Integer cominsert) {
		this.cominsert = cominsert;
		return this;
	}
	public Integer getComdelete() {
		return comdelete;
	}
	public MysqlMoDto setComdelete(Integer comdelete) {
		this.comdelete = comdelete;
		return this;
	}
	public Integer getComupdate() {
		return comupdate;
	}
	public MysqlMoDto setComupdate(Integer comupdate) {
		this.comupdate = comupdate;
		return this;
	}
	public Integer getCombegin() {
		return combegin;
	}
	public MysqlMoDto setCombegin(Integer combegin) {
		this.combegin = combegin;
		return this;
	}
	public Integer getComcommit() {
		return comcommit;
	}
	public MysqlMoDto setComcommit(Integer comcommit) {
		this.comcommit = comcommit;
		return this;
	}
	public Integer getComrollback() {
		return comrollback;
	}
	public MysqlMoDto setComrollback(Integer comrollback) {
		this.comrollback = comrollback;
		return this;
	}
	public Integer getMaxusedconnections() {
		return maxusedconnections;
	}
	public MysqlMoDto setMaxusedconnections(Integer maxusedconnections) {
		this.maxusedconnections = maxusedconnections;
		return this;
	}
	public Integer getThreadsconnected() {
		return threadsconnected;
	}
	public MysqlMoDto setThreadsconnected(Integer threadsconnected) {
		this.threadsconnected = threadsconnected;
		return this;
	}
	public Integer getConnections() {
		return connections;
	}
	public MysqlMoDto setConnections(Integer connections) {
		this.connections = connections;
		return this;
	}
	public Integer getThreadsrunning() {
		return threadsrunning;
	}
	public MysqlMoDto setThreadsrunning(Integer threadsrunning) {
		this.threadsrunning = threadsrunning;
		return this;
	}
	public Integer getBytesreceived() {
		return bytesreceived;
	}
	public MysqlMoDto setBytesreceived(Integer bytesreceived) {
		this.bytesreceived = bytesreceived;
		return this;
	}
	public Integer getBytessent() {
		return bytessent;
	}
	public MysqlMoDto setBytessent(Integer bytessent) {
		this.bytessent = bytessent;
		return this;
	}
	public Integer getOpentables() {
		return opentables;
	}
	public MysqlMoDto setOpentables(Integer opentables) {
		this.opentables = opentables;
		return this;
	}
	public Long getUptime() {
		return uptime;
	}
	public MysqlMoDto setUptime(Long uptime) {
		this.uptime = uptime;
		return this;
	}

	public String getInskey() {
		return inskey;
	}

	public MysqlMoDto setInskey(String inskey) {
		this.inskey = inskey;
		return this;
	}

	public String getInsremark() {
		return insremark;
	}

	public MysqlMoDto setInsremark(String insremark) {
		this.insremark = insremark;
		return this;
	}

	@Override
	public String toString() {
		return "MysqlMoDto [devicesn=" + devicesn + ", inskey=" + inskey + ", insremark=" + insremark + ", st=" + st
				+ ", ti=" + ti + ", message=" + message + ", host=" + host + ", port=" + port + ", tps=" + tps
				+ ", qps=" + qps + ", questions=" + questions + ", comselect=" + comselect + ", cominsert=" + cominsert
				+ ", comdelete=" + comdelete + ", comupdate=" + comupdate + ", combegin=" + combegin + ", comcommit="
				+ comcommit + ", comrollback=" + comrollback + ", maxusedconnections=" + maxusedconnections
				+ ", threadsconnected=" + threadsconnected + ", connections=" + connections + ", threadsrunning="
				+ threadsrunning + ", bytesreceived=" + bytesreceived + ", bytessent=" + bytessent + ", opentables="
				+ opentables + ", uptime=" + uptime + ", type=" + type + ", receivetime=" + receivetime + "]";
	}

	

	

	

}
